<template>
	<view class="card-wrapper" :style="{transform:`translateY(${offsetY}rpx)`,marginBottom:marginBottom}">
		<view class="card-title" v-if="title">
			<slot name="title">
				<view class="line"></view>
				<text>{{title}}</text>
			</slot>
		</view>
		<view class="card-wrapper-inner">
			<view class="card-content" :style="{justifyContent:justifyContent}">
				<slot></slot>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "z-card",
		props: {
			title: {
				type: String,
				default: ''
			},
			offsetY: {
				type: [String, Number],
				default: -106
			},
			marginBottom: {
				type: [String],
				default: '32rpx'
			},
			justifyContent: {
				type: String,
				default: 'flex-start'
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.card-wrapper {
		display: flex;
		flex-direction: column;
		// align-items: center;
		justify-content: center;
		position: relative;
		box-sizing: border-box;
		// z-index: 995;
		margin: 0 32rpx;
		background-color: #fff;
		border-radius: 30rpx;
		box-shadow: 0 5px 4px 0 #2e275515;
		// transform: translateY(-106rpx);
	}

	.card-wrapper-inner {
		padding: 32rpx 32rpx;
	}

	.card-title {
		display: flex;
		align-items: center;
		padding: 32rpx 32rpx;
		border-bottom: 1px solid #F5F5F5;
		font-size: 16px;
		color: #333;
		font-weight: 500;
	}

	.card-content {
		width: 100%;
		display: flex;
		flex-direction: column;
		// justify-content: center;
		min-height: 350rpx;
	}

	.line {
		margin-right: 8rpx;
		width: 8rpx;
		height: 32rpx;
		background-color: #275515;
		border-radius: 2px;
	}
</style>